<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2024/2/28
 * Time: 16:53
 */

namespace app\api\model;

class OrderInfo extends Base
{
    /**
     * 新增多条
     * @param $insert
     * @return bool|int|string
     */
    static function insertAllData($insert = []){
        return self::insertAll($insert);
    }

    /**
     * 多条查询
     * @param $where
     * @param $field
     * @return bool|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static function selectJoinData($where = [], $field = '*'){
        return self::join('up_goods', 'goods_id = of_goods_id', 'LEFT')
            ->join('up_goods_spec', 'spec_id = of_spec_id', 'LEFT')
            ->join('up_goods_packaging', 'packaging_id = of_packaging_id', 'LEFT')
            ->where($where)
            ->field($field)
            ->select();
    }
}